
const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Node)
    Niu: cc.Node = null;

    GongJiCount: number = 0;

    onShouShangHai() {
        this.GongJiCount++;
        if (this.GongJiCount == 5) {
            let anim_niu = this.Niu.getComponent(cc.Animation);
            anim_niu.play("winyan");
        } else {
            let anim_niu = this.Niu.getComponent(cc.Animation);
            anim_niu.play("NiuLose");
        }

    }
}
